import java.io.*;
import java.net.*;
import java.util.List;

public class FileServerHandler extends Thread {
    private Socket clientSocket;
    private String rootDirectory;

    public FileServerHandler(Socket socket, String rootDir) {
        this.clientSocket = socket;
        this.rootDirectory = rootDir;
    }

    @Override
    public void run() {
        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
            PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);

            out.println("Connection established.");

            // Handle user commands here (ls, cd, get, bye)
            // You can access the rootDirectory as needed for file operations.

            in.close();
            out.close();
            clientSocket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
